/****

Program to draw from a salpeter IMF with lower mass 0.08 Msun and 
upper mass 120 Msun

Written by MF&RD, Apr 2010

*****/


double salpeter_imf(gsl_rng *rand) {

  
  double x, mmin, mmax, gamma;
  
  x = gsl_rng_uniform (rand);
  
    mmin = 0.08;    
    mmax = 120;
    gamma = -2.35;

  // Now draw from a power-law in m and return 
  return(ranpowerlaw(mmin, mmax, gamma, rand));
}
